Integrand size = 30, antiderivative size = 148 \[ \int (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^n \, dx=\frac {i (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^n}{d (2-n)}-\frac {2 i (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^{1+n}}{a d (2-n) n}+\frac {2 i (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^{2+n}}{a^2 d n \left (4-n^2\right )} \]
I*(e*sec(d*x+c))^(-2-n)*(a+I*a*tan(d*x+c))^n/d/(2-n)-2*I*(e*sec(d*x+c))^(- 2-n)*(a+I*a*tan(d*x+c))^(1+n)/a/d/(2-n)/n+2*I*(e*sec(d*x+c))^(-2-n)*(a+I*a *tan(d*x+c))^(2+n)/a^2/d/n/(-n^2+4)
Time = 1.38 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.55 \[ \int (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^n \, dx=-\frac {i (e \sec (c+d x))^{-n} \left (-4+n^2+n^2 \cos (2 (c+d x))-2 i n \sin (2 (c+d x))\right ) (a+i a \tan (c+d x))^n}{2 d e^2 (-2+n) n (2+n)} \]
((-1/2*I)*(-4 + n^2 + n^2*Cos[2*(c + d*x)] - (2*I)*n*Sin[2*(c + d*x)])*(a + I*a*Tan[c + d*x])^n)/(d*e^2*(-2 + n)*n*(2 + n)*(e*Sec[c + d*x])^n)
Time = 0.64 (sec) , antiderivative size = 147, normalized size of antiderivative = 0.99, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3042, 3985, 3042, 3985, 3042, 3969}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-2}dx\) |
\(\Big \downarrow \) 3985 |
\(\displaystyle \frac {2 \int (e \sec (c+d x))^{-n-2} (i \tan (c+d x) a+a)^{n+1}dx}{a (2-n)}+\frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-2}}{d (2-n)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 \int (e \sec (c+d x))^{-n-2} (i \tan (c+d x) a+a)^{n+1}dx}{a (2-n)}+\frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-2}}{d (2-n)}\) |
\(\Big \downarrow \) 3985 |
\(\displaystyle \frac {2 \left (-\frac {\int (e \sec (c+d x))^{-n-2} (i \tan (c+d x) a+a)^{n+2}dx}{a n}-\frac {i (a+i a \tan (c+d x))^{n+1} (e \sec (c+d x))^{-n-2}}{d n}\right )}{a (2-n)}+\frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-2}}{d (2-n)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 \left (-\frac {\int (e \sec (c+d x))^{-n-2} (i \tan (c+d x) a+a)^{n+2}dx}{a n}-\frac {i (a+i a \tan (c+d x))^{n+1} (e \sec (c+d x))^{-n-2}}{d n}\right )}{a (2-n)}+\frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-2}}{d (2-n)}\) |
\(\Big \downarrow \) 3969 |
\(\displaystyle \frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-2}}{d (2-n)}+\frac {2 \left (\frac {i (a+i a \tan (c+d x))^{n+2} (e \sec (c+d x))^{-n-2}}{a d n (n+2)}-\frac {i (a+i a \tan (c+d x))^{n+1} (e \sec (c+d x))^{-n-2}}{d n}\right )}{a (2-n)}\) |
(I*(e*Sec[c + d*x])^(-2 - n)*(a + I*a*Tan[c + d*x])^n)/(d*(2 - n)) + (2*(( (-I)*(e*Sec[c + d*x])^(-2 - n)*(a + I*a*Tan[c + d*x])^(1 + n))/(d*n) + (I* (e*Sec[c + d*x])^(-2 - n)*(a + I*a*Tan[c + d*x])^(2 + n))/(a*d*n*(2 + n))) )/(a*(2 - n))
3.5.85.3.1 Defintions of rubi rules used
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( x_)])^(n_), x_Symbol] :> Simp[b*(d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/ (a*f*m)), x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0] && EqQ [Simplify[m + n], 0]
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( x_)])^(n_), x_Symbol] :> Simp[a*(d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/ (b*f*(m + 2*n))), x] + Simp[Simplify[m + n]/(a*(m + 2*n)) Int[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m, n} , x] && EqQ[a^2 + b^2, 0] && ILtQ[Simplify[m + n], 0] && NeQ[m + 2*n, 0]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 6.42 (sec) , antiderivative size = 2581, normalized size of antiderivative = 17.44
-1/4*I/(n-2)/d*exp(I*(d*x+c))^n/(e^n)/e^2*a^n*exp(-1/2*I*(csgn(I*a*exp(2*I *(d*x+c))/(exp(2*I*(d*x+c))+1))^3*Pi*n-csgn(I*a*exp(2*I*(d*x+c))/(exp(2*I* (d*x+c))+1))^2*csgn(I*a)*Pi*n-csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)) )*csgn(I*a*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*Pi*n+csgn(I/(exp(2*I*( d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1 ))*csgn(I*a)*Pi*n+csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*Pi*n-csg n(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*Pi*csgn(I*exp(2*I*(d*x+c)))*n -csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*Pi*csgn(I/(exp(2*I*(d*x+c ))+1))*n+csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*Pi*csgn(I/(exp(2*I* (d*x+c))+1))*csgn(I*exp(2*I*(d*x+c)))*n-n*Pi*csgn(I*e*exp(I*(d*x+c))/(exp( 2*I*(d*x+c))+1))^3+n*Pi*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I *e*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+n*Pi*csgn(I*e)*csgn(I*e*exp(I*(d *x+c))/(exp(2*I*(d*x+c))+1))^2-n*Pi*csgn(I*e)*csgn(I*exp(I*(d*x+c))/(exp(2 *I*(d*x+c))+1))*csgn(I*e*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))-n*Pi*csgn(I* exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3+n*Pi*csgn(I*exp(I*(d*x+c)))*csgn(I* exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+n*Pi*csgn(I/(exp(2*I*(d*x+c))+1))*c sgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2-n*Pi*csgn(I/(exp(2*I*(d*x+c)) +1))*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))+Pi *csgn(I*exp(2*I*(d*x+c)))^3*n-2*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I *(d*x+c)))*n+Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n+4*d...
Time = 0.25 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.20 \[ \int (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^n \, dx=\frac {{\left (-i \, n^{2} + {\left (-i \, n^{2} + 2 i \, n\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, {\left (i \, n^{2} - 4 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 i \, n\right )} \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{-n - 2} e^{\left (i \, d n x + i \, c n + n \log \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right ) + n \log \left (\frac {a}{e}\right )\right )}}{d n^{3} - 4 \, d n + {\left (d n^{3} - 4 \, d n\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (d n^{3} - 4 \, d n\right )} e^{\left (2 i \, d x + 2 i \, c\right )}} \]
(-I*n^2 + (-I*n^2 + 2*I*n)*e^(4*I*d*x + 4*I*c) - 2*(I*n^2 - 4*I)*e^(2*I*d* x + 2*I*c) - 2*I*n)*(2*e*e^(I*d*x + I*c)/(e^(2*I*d*x + 2*I*c) + 1))^(-n - 2)*e^(I*d*n*x + I*c*n + n*log(2*e*e^(I*d*x + I*c)/(e^(2*I*d*x + 2*I*c) + 1 )) + n*log(a/e))/(d*n^3 - 4*d*n + (d*n^3 - 4*d*n)*e^(4*I*d*x + 4*I*c) + 2* (d*n^3 - 4*d*n)*e^(2*I*d*x + 2*I*c))
\[ \int (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^n \, dx=\int \left (e \sec {\left (c + d x \right )}\right )^{- n - 2} \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n}\, dx \]
Time = 0.40 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.18 \[ \int (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^n \, dx=\frac {{\left (-i \, a^{n} n^{2} + 2 i \, a^{n} n\right )} \cos \left ({\left (d x + c\right )} {\left (n + 2\right )}\right ) + {\left (-i \, a^{n} n^{2} - 2 i \, a^{n} n\right )} \cos \left ({\left (d x + c\right )} {\left (n - 2\right )}\right ) - 2 \, {\left (i \, a^{n} n^{2} - 4 i \, a^{n}\right )} \cos \left ({\left (d x + c\right )} n\right ) + {\left (a^{n} n^{2} - 2 \, a^{n} n\right )} \sin \left ({\left (d x + c\right )} {\left (n + 2\right )}\right ) + {\left (a^{n} n^{2} + 2 \, a^{n} n\right )} \sin \left ({\left (d x + c\right )} {\left (n - 2\right )}\right ) + 2 \, {\left (a^{n} n^{2} - 4 \, a^{n}\right )} \sin \left ({\left (d x + c\right )} n\right )}{4 \, {\left (e^{n + 2} n^{3} - 4 \, e^{n + 2} n\right )} d} \]
1/4*((-I*a^n*n^2 + 2*I*a^n*n)*cos((d*x + c)*(n + 2)) + (-I*a^n*n^2 - 2*I*a ^n*n)*cos((d*x + c)*(n - 2)) - 2*(I*a^n*n^2 - 4*I*a^n)*cos((d*x + c)*n) + (a^n*n^2 - 2*a^n*n)*sin((d*x + c)*(n + 2)) + (a^n*n^2 + 2*a^n*n)*sin((d*x + c)*(n - 2)) + 2*(a^n*n^2 - 4*a^n)*sin((d*x + c)*n))/((e^(n + 2)*n^3 - 4* e^(n + 2)*n)*d)
\[ \int (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^n \, dx=\int { \left (e \sec \left (d x + c\right )\right )^{-n - 2} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \]
Time = 10.53 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.53 \[ \int (e \sec (c+d x))^{-2-n} (a+i a \tan (c+d x))^n \, dx=\frac {\left (\cos \left (2\,c+2\,d\,x\right )-\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )\,\left (\frac {{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n\,\left (n+2\right )}{d\,\left (n^2\,1{}\mathrm {i}-4{}\mathrm {i}\right )}+\frac {\left (\cos \left (4\,c+4\,d\,x\right )+\sin \left (4\,c+4\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n\,\left (n-2\right )}{d\,\left (n^2\,1{}\mathrm {i}-4{}\mathrm {i}\right )}+\frac {\left (\cos \left (2\,c+2\,d\,x\right )+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )\,\left (2\,n^2-8\right )\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n}{d\,n\,\left (n^2\,1{}\mathrm {i}-4{}\mathrm {i}\right )}\right )}{4\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )\,{\left (\frac {e}{\cos \left (c+d\,x\right )}\right )}^{n+2}} \]
((cos(2*c + 2*d*x) - sin(2*c + 2*d*x)*1i)*(((a + (a*sin(c + d*x)*1i)/cos(c + d*x))^n*(n + 2))/(d*(n^2*1i - 4i)) + ((cos(4*c + 4*d*x) + sin(4*c + 4*d *x)*1i)*(a + (a*sin(c + d*x)*1i)/cos(c + d*x))^n*(n - 2))/(d*(n^2*1i - 4i) ) + ((cos(2*c + 2*d*x) + sin(2*c + 2*d*x)*1i)*(2*n^2 - 8)*(a + (a*sin(c + d*x)*1i)/cos(c + d*x))^n)/(d*n*(n^2*1i - 4i))))/(4*(cos(2*c + 2*d*x)/2 + 1 /2)*(e/cos(c + d*x))^(n + 2))